# if 语句中

a = 10
if a > 5 :
    print("hello")

if a:=10 > 5:
    print("hello :=")

# while

n = 3 # 循环三次
# while n:
#     print(n)
#     n -= 1

while (n := n-1) + 1:
    print(n)

# 文件读取

fp = open("hello.txt", "r")
while True:
    line = fp.readline()
    if not line:
        break
    print(line.strip())

while line := fp.readline():
    print(line)

fp.close()

